<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>输入订单信息</title>
</head>

<script src="/js/jquery/2.0.0/jquery.min.js"></script>
<link href="/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="/js/bootstrap/3.3.6/bootstrap.min.js"></script>
<body>
<center>
    <h2 class="text-info"  align="center" style="font-family:宋体;font-weight:bold;font-size:30px;" >请填写以下信息，并选择房型</h2>
    <style>
        div{
            margin:5px;
        }
    </style>
    <form action="/HTML/createOrderTo" method="post" name="form1" >
        <div class="input-group  col-md-3">
            <span class="input-group-addon" >入住日期</span>
            <input type="text" class="form-control"  placeholder="入住时间(yyyy-mm-dd)" name="inTime" id="inTime">
        </div>
        <!--入住日期<input type="text" placeholder="入住时间(yyyy-mm-dd)" name="inTime" id="inTime" >-->
        <div class="input-group  col-md-3">
            <span class="input-group-addon" >离店日期</span>
            <input type="text" class="form-control" placeholder="离店时间(yyyy-mm-dd)" name="outTime" id="outTime">
        </div>
        <!--离店日期<input type="text" placeholder="离店时间(yyyy-mm-dd)" name="outTime" id="outTime">-->
        <div class="input-group  col-md-3">
            <span class="input-group-addon" >手机号</span>
            <input type="text" class="form-control"placeholder="手机号" name="phone" id="phone">
        </div>
        <div class="input-group  col-md-3">
            <span class="input-group-addon" >入住人姓名</span>
            <input type="text" class="form-control"placeholder="姓名" name="name" id="name">
        </div>
        <!--手机号<input type="text" placeholder="手机号" name="phone" id="phone">-->
        <!--入住人姓名<input type="text" placeholder="姓名" name="name" id="name">-->
        <div class="input-group  col-md-3">
            <span class="input-group-addon" >入住人身份证号</span>
            <input type="text" class="form-control"placeholder="身份证号" name="id_number" id="id_number">
        </div>
        <div class="input-group  col-md-3">
            <span class="input-group-addon" >入住人数</span>
            <input type="text" class="form-control" placeholder="入住人数" name="inNumber" id="inNumber">
        </div>
        <!--入住人身份证号<input type="text" placeholder="身份证号" name="id_number" id="id_number">-->
        <!--入住人数<input type="text" placeholder="入住人数" name="inNumber" id="inNumber" >-->


        <table class="table table-striped" >
            <thead>
            <th>可选房间号</th>
            <th>房型</th>
            <th>价钱</th>
            <th>选择</th>
            </thead>
            <tbody>
            <tr th:each="rooms: ${rooms}">
                <td th:text="${rooms.roomNumber}"></td>
                <td th:text="${rooms.roomType}"></td>
                <td th:text="${rooms.price}"></td>
                <td class="col-md-1">
                    <!--<input name="roomType" placeholder="房间类型" th:value="${rooms.roomType}" type="hidden"><br>-->
                    <input  name="roomNumber" id="roomNumber" th:value="${rooms.roomNumber}" type="hidden">
                    <input type="hidden" name="number" id="number" value="0">
                    <button  class="btn btn-sm btn-primary " type="submit"   onclick="func()">确认并提交订单</button>
                </td>
            </tbody>
        </table>

        <input name="orderId" placeholder="订单号" th:value="${orderId}" readonly type="hidden"><br>
        <input name="hotelName" placeholder="酒店名" th:value="${curHotel.hotelTranslatedName}"readonly type="hidden"><br>
        <input name="orderStatus" placeholder="房间状态" th:value="0"readonly type="hidden"><br>
        <input name="paymentStatus" placeholder="支付状态" th:value="0"readonly type="hidden"><br>
    </form>
</center>
<script type="text/javascript">
    function func() {
        document.getElementById("number").value=document.getElementById("roomNumber").value;
    }
    function stringToDate(){
        var inString = document.getElementById("inTime").value;
        var outString = document.getElementById("outTime").value;
        var inDate=new Date(Date.parse(inString.replace(/-/g,"/")));
        var outDate=new Date(Date.parse(outString.replace(/-/g,"/")));
        var roomDate=new Array(inDate,outDate);
        roomDate1.innerHTML="haha";
    }
</script>
</body>


</html>